$OpenBSD: patch-module_idoutils_src_idomod_c,v 1.2 2015/03/30 22:43:42 sthen Exp $
--- module/idoutils/src/idomod.c.orig	Mon Mar 30 09:38:53 2015
+++ module/idoutils/src/idomod.c	Mon Mar 30 23:28:35 2015
@@ -1443,7 +1443,7 @@ int idomod_broker_data(int event_type, void *data) {
 		procdata = (nebstruct_process_data *)data;
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%lu\n%d\n\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%lu\n%d\n\n"
 		         , IDO_API_PROCESSDATA
 		         , IDO_DATA_TYPE
 		         , procdata->type
@@ -1452,7 +1452,7 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , procdata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , procdata->timestamp.tv_sec
+		         , (long long)procdata->timestamp.tv_sec
 		         , procdata->timestamp.tv_usec
 		         , IDO_DATA_PROGRAMNAME
 		         , "Icinga"
@@ -1478,7 +1478,7 @@ int idomod_broker_data(int event_type, void *data) {
 		es[1] = ido_escape_buffer(logdata->service_description);
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%lu\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d\n\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d=%llu\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d\n\n"
 		         , IDO_API_LOGDATA
 		         , IDO_DATA_TYPE
 		         , logdata->type
@@ -1487,10 +1487,10 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , logdata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , logdata->timestamp.tv_sec
+		         , (long long)logdata->timestamp.tv_sec
 		         , logdata->timestamp.tv_usec
 		         , IDO_DATA_LOGENTRYTIME
-		         , logdata->entry_time
+		         , (long long)logdata->entry_time
 		         , IDO_DATA_LOGENTRYTYPE
 		         , logdata->data_type
 		         , IDO_DATA_LOGENTRY
@@ -1516,7 +1516,7 @@ int idomod_broker_data(int event_type, void *data) {
 		es[2] = ido_escape_buffer(cmddata->output);
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%ld.%ld\n%d=%ld.%ld\n%d=%d\n%d=%s\n%d=%d\n%d=%.5lf\n%d=%d\n%d=%s\n%d=%s\n%d\n\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d=%llu.%ld\n%d=%llu.%ld\n%d=%d\n%d=%s\n%d=%d\n%d=%.5lf\n%d=%d\n%d=%s\n%d=%s\n%d\n\n"
 		         , IDO_API_SYSTEMCOMMANDDATA
 		         , IDO_DATA_TYPE
 		         , cmddata->type
@@ -1525,13 +1525,13 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , cmddata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , cmddata->timestamp.tv_sec
+		         , (long long)cmddata->timestamp.tv_sec
 		         , cmddata->timestamp.tv_usec
 		         , IDO_DATA_STARTTIME
-		         , cmddata->start_time.tv_sec
+		         , (long long)cmddata->start_time.tv_sec
 		         , cmddata->start_time.tv_usec
 		         , IDO_DATA_ENDTIME
-		         , cmddata->end_time.tv_sec
+		         , (long long)cmddata->end_time.tv_sec
 		         , cmddata->end_time.tv_usec
 		         , IDO_DATA_TIMEOUT
 		         , cmddata->timeout
@@ -1569,7 +1569,7 @@ int idomod_broker_data(int event_type, void *data) {
 		es[6] = ido_escape_buffer(ehanddata->output);
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%ld.%ld\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%.5lf\n%d=%d\n%d=%s\n%d=%s\n%d\n\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d=%llu.%ld\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%.5lf\n%d=%d\n%d=%s\n%d=%s\n%d\n\n"
 		         , IDO_API_EVENTHANDLERDATA
 		         , IDO_DATA_TYPE
 		         , ehanddata->type
@@ -1578,7 +1578,7 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , ehanddata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , ehanddata->timestamp.tv_sec
+		         , (long long)ehanddata->timestamp.tv_sec
 		         , ehanddata->timestamp.tv_usec
 		         , IDO_DATA_HOST
 		         , (es[0] == NULL) ? "" : es[0]
@@ -1589,10 +1589,10 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_STATE
 		         , ehanddata->state
 		         , IDO_DATA_STARTTIME
-		         , ehanddata->start_time.tv_sec
+		         , (long long)ehanddata->start_time.tv_sec
 		         , ehanddata->start_time.tv_usec
 		         , IDO_DATA_ENDTIME
-		         , ehanddata->end_time.tv_sec
+		         , (long long)ehanddata->end_time.tv_sec
 		         , ehanddata->end_time.tv_usec
 		         , IDO_DATA_TIMEOUT
 		         , ehanddata->timeout
@@ -1632,7 +1632,7 @@ int idomod_broker_data(int event_type, void *data) {
 		es[5] = ido_escape_buffer(notdata->ack_data);
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%d\n%d=%ld.%ld\n%d=%ld.%ld\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d\n\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d=%d\n%d=%llu.%ld\n%d=%llu.%ld\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d\n\n"
 		         , IDO_API_NOTIFICATIONDATA
 		         , IDO_DATA_TYPE
 		         , notdata->type
@@ -1641,15 +1641,15 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , notdata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , notdata->timestamp.tv_sec
+		         , (long long)notdata->timestamp.tv_sec
 		         , notdata->timestamp.tv_usec
 		         , IDO_DATA_NOTIFICATIONTYPE
 		         , notdata->notification_type
 		         , IDO_DATA_STARTTIME
-		         , notdata->start_time.tv_sec
+		         , (long long)notdata->start_time.tv_sec
 		         , notdata->start_time.tv_usec
 		         , IDO_DATA_ENDTIME
-		         , notdata->end_time.tv_sec
+		         , (long long)notdata->end_time.tv_sec
 		         , notdata->end_time.tv_usec
 		         , IDO_DATA_HOST
 		         , (es[0] == NULL) ? "" : es[0]
@@ -1709,7 +1709,7 @@ int idomod_broker_data(int event_type, void *data) {
 		}
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d=%ld.%ld\n%d=%ld.%ld\n%d=%d\n%d=%.5lf\n%d=%.5lf\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d\n\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d=%llu.%ld\n%d=%llu.%ld\n%d=%d\n%d=%.5lf\n%d=%.5lf\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d\n\n"
 		         , IDO_API_SERVICECHECKDATA
 		         , IDO_DATA_TYPE
 		         , scdata->type
@@ -1718,7 +1718,7 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , scdata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , scdata->timestamp.tv_sec
+		         , (long long)scdata->timestamp.tv_sec
 		         , scdata->timestamp.tv_usec
 		         , IDO_DATA_HOST
 		         , (es[0] == NULL) ? "" : es[0]
@@ -1743,10 +1743,10 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_COMMANDLINE
 		         , (es[4] == NULL) ? "" : es[4]
 		         , IDO_DATA_STARTTIME
-		         , scdata->start_time.tv_sec
+		         , (long long)scdata->start_time.tv_sec
 		         , scdata->start_time.tv_usec
 		         , IDO_DATA_ENDTIME
-		         , scdata->end_time.tv_sec
+		         , (long long)scdata->end_time.tv_sec
 		         , scdata->end_time.tv_usec
 		         , IDO_DATA_EARLYTIMEOUT
 		         , scdata->early_timeout
@@ -1799,7 +1799,7 @@ int idomod_broker_data(int event_type, void *data) {
 		}
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d=%ld.%ld\n%d=%ld.%ld\n%d=%d\n%d=%.5lf\n%d=%.5lf\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d\n\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d=%llu.%ld\n%d=%llu.%ld\n%d=%d\n%d=%.5lf\n%d=%.5lf\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d\n\n"
 		         , IDO_API_HOSTCHECKDATA
 		         , IDO_DATA_TYPE
 		         , hcdata->type
@@ -1808,7 +1808,7 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , hcdata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , hcdata->timestamp.tv_sec
+		         , (long long)hcdata->timestamp.tv_sec
 		         , hcdata->timestamp.tv_usec
 		         , IDO_DATA_HOST
 		         , (es[0] == NULL) ? "" : es[0]
@@ -1831,10 +1831,10 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_COMMANDLINE
 		         , (es[3] == NULL) ? "" : es[3]
 		         , IDO_DATA_STARTTIME
-		         , hcdata->start_time.tv_sec
+		         , (long long)hcdata->start_time.tv_sec
 		         , hcdata->start_time.tv_usec
 		         , IDO_DATA_ENDTIME
-		         , hcdata->end_time.tv_sec
+		         , (long long)hcdata->end_time.tv_sec
 		         , hcdata->end_time.tv_usec
 		         , IDO_DATA_EARLYTIMEOUT
 		         , hcdata->early_timeout
@@ -1868,7 +1868,7 @@ int idomod_broker_data(int event_type, void *data) {
 		es[3] = ido_escape_buffer(comdata->comment_data);
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%d\n%d=%s\n%d=%s\n%d=%lu\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%lu\n%d=%lu\n%d\n\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d=%d\n%d=%s\n%d=%s\n%d=%llu\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%llu\n%d=%lu\n%d\n\n"
 		         , IDO_API_COMMENTDATA
 		         , IDO_DATA_TYPE
 		         , comdata->type
@@ -1877,7 +1877,7 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , comdata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , comdata->timestamp.tv_sec
+		         , (long long)comdata->timestamp.tv_sec
 		         , comdata->timestamp.tv_usec
 		         , IDO_DATA_COMMENTTYPE
 		         , comdata->comment_type
@@ -1886,7 +1886,7 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_SERVICE
 		         , (es[1] == NULL) ? "" : es[1]
 		         , IDO_DATA_ENTRYTIME
-		         , (unsigned long)comdata->entry_time
+		         , (long long)comdata->entry_time
 		         , IDO_DATA_AUTHORNAME
 		         , (es[2] == NULL) ? "" : es[2]
 		         , IDO_DATA_COMMENT
@@ -1900,7 +1900,7 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_EXPIRES
 		         , comdata->expires
 		         , IDO_DATA_EXPIRATIONTIME
-		         , (unsigned long)comdata->expire_time
+		         , (long long)comdata->expire_time
 		         , IDO_DATA_COMMENTID
 		         , comdata->comment_id
 		         , IDO_API_ENDDATA
@@ -1921,7 +1921,7 @@ int idomod_broker_data(int event_type, void *data) {
 		es[3] = ido_escape_buffer(downdata->comment_data);
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%d\n%d=%s\n%d=%s\n%d=%lu\n%d=%s\n%d=%s\n%d=%lu\n%d=%lu\n%d=%d\n%d=%lu\n%d=%lu\n%d=%lu\n%d=%d\n%d=%lu\n%d\n\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d=%d\n%d=%s\n%d=%s\n%d=%llu\n%d=%s\n%d=%s\n%d=%lu\n%d=%lu\n%d=%d\n%d=%lu\n%d=%lu\n%d=%lu\n%d=%d\n%d=%lu\n%d\n\n"
 		         , IDO_API_DOWNTIMEDATA
 		         , IDO_DATA_TYPE
 		         , downdata->type
@@ -1930,7 +1930,7 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , downdata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , downdata->timestamp.tv_sec
+		         , (long long)downdata->timestamp.tv_sec
 		         , downdata->timestamp.tv_usec
 		         , IDO_DATA_DOWNTIMETYPE
 		         , downdata->downtime_type
@@ -1981,7 +1981,7 @@ int idomod_broker_data(int event_type, void *data) {
 			temp_comment = find_service_comment(flapdata->comment_id);
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%d\n%d=%s\n%d=%s\n%d=%.5lf\n%d=%.5lf\n%d=%.5lf\n%d=%lu\n%d=%lu\n%d\n\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d=%d\n%d=%s\n%d=%s\n%d=%.5lf\n%d=%.5lf\n%d=%.5lf\n%d=%lu\n%d=%lu\n%d\n\n"
 		         , IDO_API_FLAPPINGDATA
 		         , IDO_DATA_TYPE
 		         , flapdata->type
@@ -1990,7 +1990,7 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , flapdata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , flapdata->timestamp.tv_sec
+		         , (long long)flapdata->timestamp.tv_sec
 		         , flapdata->timestamp.tv_usec
 		         , IDO_DATA_FLAPPINGTYPE
 		         , flapdata->flapping_type
@@ -2024,7 +2024,7 @@ int idomod_broker_data(int event_type, void *data) {
 		es[1] = ido_escape_buffer(psdata->global_service_event_handler);
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%lu\n%d=%d\n%d=%d\n%d=%lu\n%d=%lu\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%lu\n%d=%lu\n%d=%s\n%d=%s\n%d=%lu\n%d=%s\n%d\n\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d=%lu\n%d=%d\n%d=%d\n%d=%lu\n%d=%lu\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%lu\n%d=%lu\n%d=%s\n%d=%s\n%d=%llu\n%d=%s\n%d\n\n"
 		         , IDO_API_PROGRAMSTATUSDATA
 		         , IDO_DATA_TYPE
 		         , psdata->type
@@ -2033,7 +2033,7 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , psdata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , psdata->timestamp.tv_sec
+		         , (long long)psdata->timestamp.tv_sec
 		         , psdata->timestamp.tv_usec
 		         , IDO_DATA_PROGRAMSTARTTIME
 		         , (unsigned long)psdata->program_start
@@ -2076,7 +2076,7 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_GLOBALSERVICEEVENTHANDLER
 		         , (es[1] == NULL) ? "" : es[1]
 			 , IDO_DATA_DISABLED_NOTIFICATIONS_EXPIRE_TIME
-			 , psdata->disable_notifications_expire_time
+			 , (long long)psdata->disable_notifications_expire_time
 		         , IDO_DATA_PROGRAMVERSION
 		         , get_program_version()
 		         , IDO_API_ENDDATA
@@ -2119,7 +2119,7 @@ int idomod_broker_data(int event_type, void *data) {
 		retry_interval = temp_host->retry_interval;
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%lu\n%d=%lu\n%d=%d\n%d=%lu\n%d=%lu\n%d=%d\n%d=%lu\n%d=%lu\n%d=%lu\n%d=%d\n%d=%lu\n%d=%lu\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%.5lf\n%d=%.5lf\n%d=%.5lf\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%lu\n%d=%s\n%d=%s\n%d=%lf\n%d=%lf\n%d=%s\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%lu\n%d=%lu\n%d=%d\n%d=%lu\n%d=%lu\n%d=%d\n%d=%lu\n%d=%lu\n%d=%lu\n%d=%d\n%d=%lu\n%d=%lu\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%.5lf\n%d=%.5lf\n%d=%.5lf\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%lu\n%d=%s\n%d=%s\n%d=%lf\n%d=%lf\n%d=%s\n"
 		         , IDO_API_HOSTSTATUSDATA
 		         , IDO_DATA_TYPE
 		         , hsdata->type
@@ -2128,7 +2128,7 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , hsdata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , hsdata->timestamp.tv_sec
+		         , (long long)hsdata->timestamp.tv_sec
 		         , hsdata->timestamp.tv_usec
 		         , IDO_DATA_HOST
 		         , (es[0] == NULL) ? "" : es[0]
@@ -2290,7 +2290,7 @@ int idomod_broker_data(int event_type, void *data) {
 		}
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%lu\n%d=%lu\n%d=%d\n%d=%lu\n%d=%lu\n%d=%d\n%d=%lu\n%d=%lu\n%d=%lu\n%d=%lu\n%d=%d\n%d=%lu\n%d=%lu\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%.5lf\n%d=%.5lf\n%d=%.5lf\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%lu\n%d=%s\n%d=%s\n%d=%lf\n%d=%lf\n%d=%s\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%lu\n%d=%lu\n%d=%d\n%d=%lu\n%d=%lu\n%d=%d\n%d=%lu\n%d=%lu\n%d=%lu\n%d=%lu\n%d=%d\n%d=%lu\n%d=%lu\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%.5lf\n%d=%.5lf\n%d=%.5lf\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%lu\n%d=%s\n%d=%s\n%d=%lf\n%d=%lf\n%d=%s\n"
 		         , IDO_API_SERVICESTATUSDATA
 		         , IDO_DATA_TYPE
 		         , ssdata->type
@@ -2299,7 +2299,7 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , ssdata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , ssdata->timestamp.tv_sec
+		         , (long long)ssdata->timestamp.tv_sec
 		         , ssdata->timestamp.tv_usec
 		         , IDO_DATA_HOST
 		         , (es[0] == NULL) ? "" : es[0]
@@ -2446,7 +2446,7 @@ int idomod_broker_data(int event_type, void *data) {
 		es[0] = ido_escape_buffer(temp_contact->name);
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%s\n%d=%d\n%d=%d\n%d=%lu\n%d=%lu\n%d=%lu\n%d=%lu\n%d=%lu\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d=%s\n%d=%d\n%d=%d\n%d=%llu\n%d=%llu\n%d=%lu\n%d=%lu\n%d=%lu\n"
 		         , IDO_API_CONTACTSTATUSDATA
 		         , IDO_DATA_TYPE
 		         , csdata->type
@@ -2455,7 +2455,7 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , csdata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , csdata->timestamp.tv_sec
+		         , (long long)csdata->timestamp.tv_sec
 		         , csdata->timestamp.tv_usec
 		         , IDO_DATA_CONTACTNAME
 		         , (es[0] == NULL) ? "" : es[0]
@@ -2464,9 +2464,9 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_SERVICENOTIFICATIONSENABLED
 		         , temp_contact->service_notifications_enabled
 		         , IDO_DATA_LASTHOSTNOTIFICATION
-		         , temp_contact->last_host_notification
+		         , (long long)temp_contact->last_host_notification
 		         , IDO_DATA_LASTSERVICENOTIFICATION
-		         , temp_contact->last_service_notification
+		         , (long long)temp_contact->last_service_notification
 
 		         , IDO_DATA_MODIFIEDCONTACTATTRIBUTES
 		         , temp_contact->modified_attributes
@@ -2522,7 +2522,7 @@ int idomod_broker_data(int event_type, void *data) {
 		es[1] = ido_escape_buffer(global_service_event_handler);
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%d\n%d=%lu\n%d=%lu\n%d=%lu\n%d=%lu\n%d=%s\n%d=%s\n%d\n\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d=%d\n%d=%lu\n%d=%lu\n%d=%lu\n%d=%lu\n%d=%s\n%d=%s\n%d\n\n"
 		         , IDO_API_ADAPTIVEPROGRAMDATA
 		         , IDO_DATA_TYPE, apdata->type
 		         , IDO_DATA_FLAGS
@@ -2530,7 +2530,7 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , apdata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , apdata->timestamp.tv_sec
+		         , (long long)apdata->timestamp.tv_sec
 		         , apdata->timestamp.tv_usec
 		         , IDO_DATA_COMMANDTYPE
 		         , apdata->command_type
@@ -2570,7 +2570,7 @@ int idomod_broker_data(int event_type, void *data) {
 		es[2] = ido_escape_buffer(temp_host->host_check_command);
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%d\n%d=%lu\n%d=%lu\n%d=%s\n%d=%s\n%d=%s\n%d=%lf\n%d=%lf\n%d=%d\n%d\n\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d=%d\n%d=%lu\n%d=%lu\n%d=%s\n%d=%s\n%d=%s\n%d=%lf\n%d=%lf\n%d=%d\n%d\n\n"
 		         , IDO_API_ADAPTIVEHOSTDATA
 		         , IDO_DATA_TYPE
 		         , ahdata->type
@@ -2579,7 +2579,7 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , ahdata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , ahdata->timestamp.tv_sec
+		         , (long long)ahdata->timestamp.tv_sec
 		         , ahdata->timestamp.tv_usec
 		         , IDO_DATA_COMMANDTYPE
 		         , ahdata->command_type
@@ -2622,7 +2622,7 @@ int idomod_broker_data(int event_type, void *data) {
 		es[3] = ido_escape_buffer(temp_service->service_check_command);
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%d\n%d=%lu\n%d=%lu\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%lf\n%d=%lf\n%d=%d\n%d\n\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d=%d\n%d=%lu\n%d=%lu\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%lf\n%d=%lf\n%d=%d\n%d\n\n"
 		         , IDO_API_ADAPTIVESERVICEDATA
 		         , IDO_DATA_TYPE
 		         , asdata->type
@@ -2631,7 +2631,7 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , asdata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , asdata->timestamp.tv_sec
+		         , (long long)asdata->timestamp.tv_sec
 		         , asdata->timestamp.tv_usec
 		         , IDO_DATA_COMMANDTYPE
 		         , asdata->command_type
@@ -2673,7 +2673,7 @@ int idomod_broker_data(int event_type, void *data) {
 		es[0] = ido_escape_buffer(temp_contact->name);
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%d\n%d=%lu\n%d=%lu\n%d=%lu\n%d=%lu\n%d=%lu\n%d=%lu\n%d=%s\n%d=%d\n%d=%d\n%d\n\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d=%d\n%d=%lu\n%d=%lu\n%d=%lu\n%d=%lu\n%d=%lu\n%d=%lu\n%d=%s\n%d=%d\n%d=%d\n%d\n\n"
 		         , IDO_API_ADAPTIVECONTACTDATA
 		         , IDO_DATA_TYPE
 		         , acdata->type
@@ -2682,7 +2682,7 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , acdata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , acdata->timestamp.tv_sec
+		         , (long long)acdata->timestamp.tv_sec
 		         , acdata->timestamp.tv_usec
 		         , IDO_DATA_COMMANDTYPE
 		         , acdata->command_type
@@ -2720,7 +2720,7 @@ int idomod_broker_data(int event_type, void *data) {
 		es[1] = ido_escape_buffer(ecdata->command_args);
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%d\n%d=%lu\n%d=%s\n%d=%s\n%d\n\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d=%d\n%d=%lu\n%d=%s\n%d=%s\n%d\n\n"
 		         , IDO_API_EXTERNALCOMMANDDATA
 		         , IDO_DATA_TYPE
 		         , ecdata->type
@@ -2729,7 +2729,7 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , ecdata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , ecdata->timestamp.tv_sec
+		         , (long long)ecdata->timestamp.tv_sec
 		         , ecdata->timestamp.tv_usec
 		         , IDO_DATA_COMMANDTYPE
 		         , ecdata->command_type
@@ -2752,7 +2752,7 @@ int idomod_broker_data(int event_type, void *data) {
 		agsdata = (nebstruct_aggregated_status_data *)data;
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d\n\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d\n\n"
 		         , IDO_API_AGGREGATEDSTATUSDATA
 		         , IDO_DATA_TYPE
 		         , agsdata->type
@@ -2761,7 +2761,7 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , agsdata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , agsdata->timestamp.tv_sec
+		         , (long long)agsdata->timestamp.tv_sec
 		         , agsdata->timestamp.tv_usec
 		         , IDO_API_ENDDATA
 		        );
@@ -2776,7 +2776,7 @@ int idomod_broker_data(int event_type, void *data) {
 		rdata = (nebstruct_retention_data *)data;
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d\n\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d\n\n"
 		         , IDO_API_RETENTIONDATA
 		         , IDO_DATA_TYPE
 		         , rdata->type
@@ -2785,7 +2785,7 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , rdata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , rdata->timestamp.tv_sec
+		         , (long long)rdata->timestamp.tv_sec
 		         , rdata->timestamp.tv_usec
 		         , IDO_API_ENDDATA
 		        );
@@ -2809,7 +2809,7 @@ int idomod_broker_data(int event_type, void *data) {
 		es[6] = ido_escape_buffer(cnotdata->contact_name);
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%d\n%d=%ld.%ld\n%d=%ld.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d\n\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d=%d\n%d=%llu.%ld\n%d=%llu.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d\n\n"
 		         , IDO_API_CONTACTNOTIFICATIONDATA
 		         , IDO_DATA_TYPE
 		         , cnotdata->type
@@ -2818,15 +2818,15 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , cnotdata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , cnotdata->timestamp.tv_sec
+		         , (long long)cnotdata->timestamp.tv_sec
 		         , cnotdata->timestamp.tv_usec
 		         , IDO_DATA_NOTIFICATIONTYPE
 		         , cnotdata->notification_type
 		         , IDO_DATA_STARTTIME
-		         , cnotdata->start_time.tv_sec
+		         , (long long)cnotdata->start_time.tv_sec
 		         , cnotdata->start_time.tv_usec
 		         , IDO_DATA_ENDTIME
-		         , cnotdata->end_time.tv_sec
+		         , (long long)cnotdata->end_time.tv_sec
 		         , cnotdata->end_time.tv_usec
 		         , IDO_DATA_HOST
 		         , (es[0] == NULL) ? "" : es[0]
@@ -2870,7 +2870,7 @@ int idomod_broker_data(int event_type, void *data) {
 		es[8] = ido_escape_buffer(cnotmdata->command_args);
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%d\n%d=%ld.%ld\n%d=%ld.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d\n\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d=%d\n%d=%llu.%ld\n%d=%llu.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d\n\n"
 		         , IDO_API_CONTACTNOTIFICATIONMETHODDATA
 		         , IDO_DATA_TYPE
 		         , cnotmdata->type
@@ -2879,15 +2879,15 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , cnotmdata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , cnotmdata->timestamp.tv_sec
+		         , (long long)cnotmdata->timestamp.tv_sec
 		         , cnotmdata->timestamp.tv_usec
 		         , IDO_DATA_NOTIFICATIONTYPE
 		         , cnotmdata->notification_type
 		         , IDO_DATA_STARTTIME
-		         , cnotmdata->start_time.tv_sec
+		         , (long long)cnotmdata->start_time.tv_sec
 		         , cnotmdata->start_time.tv_usec
 		         , IDO_DATA_ENDTIME
-		         , cnotmdata->end_time.tv_sec
+		         , (long long)cnotmdata->end_time.tv_sec
 		         , cnotmdata->end_time.tv_usec
 		         , IDO_DATA_HOST
 		         , (es[0] == NULL) ? "" : es[0]
@@ -2929,7 +2929,7 @@ int idomod_broker_data(int event_type, void *data) {
 		es[3] = ido_escape_buffer(ackdata->comment_data);
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%ld\n%d\n\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%llu\n%d\n\n"
 		         , IDO_API_ACKNOWLEDGEMENTDATA
 		         , IDO_DATA_TYPE
 		         , ackdata->type
@@ -2938,7 +2938,7 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , ackdata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , ackdata->timestamp.tv_sec
+		         , (long long)ackdata->timestamp.tv_sec
 		         , ackdata->timestamp.tv_usec
 		         , IDO_DATA_ACKNOWLEDGEMENTTYPE
 		         , ackdata->acknowledgement_type
@@ -2959,7 +2959,7 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_NOTIFYCONTACTS
 		         , ackdata->notify_contacts
 			 , IDO_DATA_END_TIME
-			 , ackdata->end_time
+			 , (long long)ackdata->end_time
 		         , IDO_API_ENDDATA
 		        );
 
@@ -3001,7 +3001,7 @@ int idomod_broker_data(int event_type, void *data) {
 		}
 
 		snprintf(temp_buffer, IDOMOD_MAX_BUFLEN - 1
-		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%d\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%s\n%d=%s\n%d\n\n"
+		         , "\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%llu.%ld\n%d=%d\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%s\n%d=%s\n%d\n\n"
 		         , IDO_API_STATECHANGEDATA
 		         , IDO_DATA_TYPE
 		         , schangedata->type
@@ -3010,7 +3010,7 @@ int idomod_broker_data(int event_type, void *data) {
 		         , IDO_DATA_ATTRIBUTES
 		         , schangedata->attr
 		         , IDO_DATA_TIMESTAMP
-		         , schangedata->timestamp.tv_sec
+		         , (long long)schangedata->timestamp.tv_sec
 		         , schangedata->timestamp.tv_usec
 		         , IDO_DATA_STATECHANGETYPE
 		         , schangedata->statechange_type
@@ -3126,12 +3126,12 @@ int idomod_write_config(int config_type) {
 
 	/* record start of config dump */
 	snprintf(temp_buffer, sizeof(temp_buffer) - 1
-	         , "\n\n%d:\n%d=%s\n%d=%ld.%ld\n%d\n\n"
+	         , "\n\n%d:\n%d=%s\n%d=%llu.%ld\n%d\n\n"
 	         , IDO_API_STARTCONFIGDUMP
 	         , IDO_DATA_CONFIGDUMPTYPE
 	         , (config_type == IDOMOD_CONFIG_DUMP_ORIGINAL) ? IDO_API_CONFIGDUMP_ORIGINAL : IDO_API_CONFIGDUMP_RETAINED
 	         , IDO_DATA_TIMESTAMP
-	         , now.tv_sec
+	         , (long long)now.tv_sec
 	         , now.tv_usec
 	         , IDO_API_ENDDATA
 	        );
@@ -3145,10 +3145,10 @@ int idomod_write_config(int config_type) {
 
 	/* record end of config dump */
 	snprintf(temp_buffer, sizeof(temp_buffer) - 1
-	         , "\n\n%d:\n%d=%ld.%ld\n%d\n\n"
+	         , "\n\n%d:\n%d=%llu.%ld\n%d\n\n"
 	         , IDO_API_ENDCONFIGDUMP
 	         , IDO_DATA_TIMESTAMP
-	         , now.tv_sec
+	         , (long long)now.tv_sec
 	         , now.tv_usec
 	         , IDO_API_ENDDATA
 	        );
@@ -3232,10 +3232,10 @@ int idomod_write_object_config(int config_type) {
 		es[1] = ido_escape_buffer(temp_command->command_line);
 
 		snprintf(temp_buffer, sizeof(temp_buffer) - 1
-		         , "\n%d:\n%d=%ld.%ld\n%d=%s\n%d=%s\n%d\n\n"
+		         , "\n%d:\n%d=%llu.%ld\n%d=%s\n%d=%s\n%d\n\n"
 		         , IDO_API_COMMANDDEFINITION
 		         , IDO_DATA_TIMESTAMP
-		         , now.tv_sec
+		         , (long long)now.tv_sec
 		         , now.tv_usec
 		         , IDO_DATA_COMMANDNAME
 		         , (es[0] == NULL) ? "" : es[0]
@@ -3259,10 +3259,10 @@ int idomod_write_object_config(int config_type) {
 		es[1] = ido_escape_buffer(temp_timeperiod->alias);
 
 		snprintf(temp_buffer, sizeof(temp_buffer) - 1
-		         , "\n%d:\n%d=%ld.%ld\n%d=%s\n%d=%s\n"
+		         , "\n%d:\n%d=%llu.%ld\n%d=%s\n%d=%s\n"
 		         , IDO_API_TIMEPERIODDEFINITION
 		         , IDO_DATA_TIMESTAMP
-		         , now.tv_sec
+		         , (long long)now.tv_sec
 		         , now.tv_usec
 		         , IDO_DATA_TIMEPERIODNAME
 		         , (es[0] == NULL) ? "" : es[0]
@@ -3321,10 +3321,10 @@ int idomod_write_object_config(int config_type) {
 		can_submit_commands = temp_contact->can_submit_commands;
 
 		snprintf(temp_buffer, sizeof(temp_buffer) - 1
-		         , "\n%d:\n%d=%ld.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n"
+		         , "\n%d:\n%d=%llu.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n"
 		         , IDO_API_CONTACTDEFINITION
 		         , IDO_DATA_TIMESTAMP
-		         , now.tv_sec
+		         , (long long)now.tv_sec
 		         , now.tv_usec
 		         , IDO_DATA_CONTACTNAME
 		         , (es[0] == NULL) ? "" : es[0]
@@ -3466,10 +3466,10 @@ int idomod_write_object_config(int config_type) {
 		es[1] = ido_escape_buffer(temp_contactgroup->alias);
 
 		snprintf(temp_buffer, sizeof(temp_buffer) - 1
-		         , "\n%d:\n%d=%ld.%ld\n%d=%s\n%d=%s\n"
+		         , "\n%d:\n%d=%llu.%ld\n%d=%s\n%d=%s\n"
 		         , IDO_API_CONTACTGROUPDEFINITION
 		         , IDO_DATA_TIMESTAMP
-		         , now.tv_sec
+		         , (long long)now.tv_sec
 		         , now.tv_usec
 		         , IDO_DATA_CONTACTGROUPNAME
 		         , (es[0] == NULL) ? "" : es[0]
@@ -3548,10 +3548,10 @@ int idomod_write_object_config(int config_type) {
 		es[15] = ido_escape_buffer(temp_host->address6);
 
 		snprintf(temp_buffer, sizeof(temp_buffer) - 1
-		         , "\n%d:\n%d=%ld.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%lf\n%d=%lf\n%d=%d\n%d=%lf\n%d=%lf\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%lf\n%d=%lf\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%lf\n%d=%lf\n%d=%lf\n"
+		         , "\n%d:\n%d=%llu.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%lf\n%d=%lf\n%d=%d\n%d=%lf\n%d=%lf\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%lf\n%d=%lf\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%lf\n%d=%lf\n%d=%lf\n"
 		         , IDO_API_HOSTDEFINITION
 		         , IDO_DATA_TIMESTAMP
-		         , now.tv_sec
+		         , (long long)now.tv_sec
 		         , now.tv_usec
 		         , IDO_DATA_HOSTNAME
 		         , (es[0] == NULL) ? "" : es[0]
@@ -3757,10 +3757,10 @@ int idomod_write_object_config(int config_type) {
 		es[1] = ido_escape_buffer(temp_hostgroup->alias);
 
 		snprintf(temp_buffer, sizeof(temp_buffer) - 1
-		         , "\n%d:\n%d=%ld.%ld\n%d=%s\n%d=%s\n"
+		         , "\n%d:\n%d=%llu.%ld\n%d=%s\n%d=%s\n"
 		         , IDO_API_HOSTGROUPDEFINITION
 		         , IDO_DATA_TIMESTAMP
-		         , now.tv_sec
+		         , (long long)now.tv_sec
 		         , now.tv_usec
 		         , IDO_DATA_HOSTGROUPNAME
 		         , (es[0] == NULL) ? "" : es[0]
@@ -3827,10 +3827,10 @@ int idomod_write_object_config(int config_type) {
 		es[12] = ido_escape_buffer(temp_service->display_name);
 
 		snprintf(temp_buffer, sizeof(temp_buffer) - 1
-		         , "\n%d:\n%d=%ld.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%lf\n%d=%lf\n%d=%d\n%d=%lf\n%d=%lf\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%lf\n%d=%lf\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n"
+		         , "\n%d:\n%d=%llu.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%lf\n%d=%lf\n%d=%d\n%d=%lf\n%d=%lf\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%lf\n%d=%lf\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n"
 		         , IDO_API_SERVICEDEFINITION
 		         , IDO_DATA_TIMESTAMP
-		         , now.tv_sec
+		         , (long long)now.tv_sec
 		         , now.tv_usec
 		         , IDO_DATA_HOSTNAME
 		         , (es[0] == NULL) ? "" : es[0]
@@ -4005,10 +4005,10 @@ int idomod_write_object_config(int config_type) {
 		es[1] = ido_escape_buffer(temp_servicegroup->alias);
 
 		snprintf(temp_buffer, sizeof(temp_buffer) - 1
-		         , "\n%d:\n%d=%ld.%ld\n%d=%s\n%d=%s\n"
+		         , "\n%d:\n%d=%llu.%ld\n%d=%s\n%d=%s\n"
 		         , IDO_API_SERVICEGROUPDEFINITION
 		         , IDO_DATA_TIMESTAMP
-		         , now.tv_sec
+		         , (long long)now.tv_sec
 		         , now.tv_usec
 		         , IDO_DATA_SERVICEGROUPNAME
 		         , (es[0] == NULL) ? "" : es[0]
@@ -4060,10 +4060,10 @@ int idomod_write_object_config(int config_type) {
 		es[1] = ido_escape_buffer(temp_hostescalation->escalation_period);
 
 		snprintf(temp_buffer, sizeof(temp_buffer) - 1
-		         , "\n%d:\n%d=%ld.%ld\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%lf\n%d=%d\n%d=%d\n%d=%d\n"
+		         , "\n%d:\n%d=%llu.%ld\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%lf\n%d=%d\n%d=%d\n%d=%d\n"
 		         , IDO_API_HOSTESCALATIONDEFINITION
 		         , IDO_DATA_TIMESTAMP
-		         , now.tv_sec
+		         , (long long)now.tv_sec
 		         , now.tv_usec
 		         , IDO_DATA_HOSTNAME
 		         , (es[0] == NULL) ? "" : es[0]
@@ -4141,10 +4141,10 @@ int idomod_write_object_config(int config_type) {
 		es[2] = ido_escape_buffer(temp_serviceescalation->escalation_period);
 
 		snprintf(temp_buffer, sizeof(temp_buffer) - 1
-		         , "\n%d:\n%d=%ld.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%lf\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n"
+		         , "\n%d:\n%d=%llu.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%lf\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n"
 		         , IDO_API_SERVICEESCALATIONDEFINITION
 		         , IDO_DATA_TIMESTAMP
-		         , now.tv_sec
+		         , (long long)now.tv_sec
 		         , now.tv_usec
 		         , IDO_DATA_HOSTNAME
 		         , (es[0] == NULL) ? "" : es[0]
@@ -4228,10 +4228,10 @@ int idomod_write_object_config(int config_type) {
 		es[2] = ido_escape_buffer(temp_hostdependency->dependency_period);
 
 		snprintf(temp_buffer, sizeof(temp_buffer) - 1
-		         , "\n%d:\n%d=%ld.%ld\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n"
+		         , "\n%d:\n%d=%llu.%ld\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n"
 		         , IDO_API_HOSTDEPENDENCYDEFINITION
 		         , IDO_DATA_TIMESTAMP
-		         , now.tv_sec
+		         , (long long)now.tv_sec
 		         , now.tv_usec
 		         , IDO_DATA_HOSTNAME
 		         , (es[0] == NULL) ? "" : es[0]
@@ -4281,10 +4281,10 @@ int idomod_write_object_config(int config_type) {
 		es[4] = ido_escape_buffer(temp_servicedependency->dependency_period);
 
 		snprintf(temp_buffer, sizeof(temp_buffer) - 1
-		         , "\n%d:\n%d=%ld.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n"
+		         , "\n%d:\n%d=%llu.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%s\n%d=%d\n%d=%d\n%d=%d\n%d=%d\n"
 		         , IDO_API_SERVICEDEPENDENCYDEFINITION
 		         , IDO_DATA_TIMESTAMP
-		         , now.tv_sec
+		         , (long long)now.tv_sec
 		         , now.tv_usec
 		         , IDO_DATA_HOSTNAME
 		         , (es[0] == NULL) ? "" : es[0]
@@ -4372,10 +4372,10 @@ int idomod_write_main_config_file(void) {
 	gettimeofday(&now, NULL);
 
 	if (asprintf(&temp_buffer
-	             , "\n%d:\n%d=%ld.%ld\n%d=%s\n"
+	             , "\n%d:\n%d=%llu.%ld\n%d=%s\n"
 	             , IDO_API_MAINCONFIGFILEVARIABLES
 	             , IDO_DATA_TIMESTAMP
-	             , now.tv_sec
+	             , (long long)now.tv_sec
 	             , now.tv_usec
 	             , IDO_DATA_CONFIGFILENAME
 	             , config_file
@@ -4481,10 +4481,10 @@ int idomod_write_runtime_variables(void) {
 	gettimeofday(&now, NULL);
 
 	if (asprintf(&temp_buffer
-	             , "\n%d:\n%d=%ld.%ld\n"
+	             , "\n%d:\n%d=%llu.%ld\n"
 	             , IDO_API_RUNTIMEVARIABLES
 	             , IDO_DATA_TIMESTAMP
-	             , now.tv_sec
+	             , (long long)now.tv_sec
 	             , now.tv_usec
 	            ) == -1)
 		temp_buffer = NULL;
@@ -4642,7 +4642,7 @@ int idomod_log_debug_info(int level, int verbosity, co
 
 	/* write the timestamp */
 	gettimeofday(&current_time, NULL);
-	fprintf(idomod_debug_file_fp, "[%lu.%06lu] [%03d.%d] [pid=%lu] ", current_time.tv_sec, current_time.tv_usec, level, verbosity, (unsigned long)getpid());
+	fprintf(idomod_debug_file_fp, "[%llu.%06lu] [%03d.%d] [pid=%lu] ", (long long)current_time.tv_sec, current_time.tv_usec, level, verbosity, (unsigned long)getpid());
 
 	/* write the data */
 	va_start(ap, fmt);
